package com.plian.system.wrapper.sys;

import com.plian.system.dto.sys.OfficeDTO;
import com.plian.system.entity.sys.Office;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.sys.OfficeVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperConstant;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;


@Mapper(componentModel = WrapperConstant.SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface OfficeWrapper extends BaseWrapper<Office, OfficeDTO, OfficeVO> {


    /**
     * Entity转VO
     *
     * @param entity /
     * @return /
     */
    @Override
    @Mappings(value = {
            @Mapping(source = "orgId", target = "orgName", qualifiedByName = WrapperConstant.ORG_ID_TO_NAME),
    })
    OfficeVO entityToVO(Office entity);
}
